Problem s volanim DLL od Matlabu

Otázka od: Matej K

6. 5. 2004 23:14

Ahoj

Potrebuji volat funkci z DLL vytvorene v programu Matlab. Rekl jsem si, ze na
klasickem pouziti cizi
DLL nic neni, kdyz clovek zna jmena vnitrnich procedur, ale marne se to snazim
rozchodit.

Stale mi to hlasi chybu v okamziku zavolani prilinkovane procedury
"DeterminantLibInitialize".

velmi prosim, nevite co s tim?

Matej K.


access violation at 0x4100118c: read of address 0xfeeefeee
8B 10 89 16 5E 5B C3 90 89 00 89 40


var l : THandle;
    chPathName : array[0..80] of char;
    mlfDeterminant : function(s : String):Integer; stdcall;
    DeterminantLibInitialize : procedure; stdcall;
    DeterminantLibTerminate : procedure; stdcall;
begin
  @mlfDeterminant := nil;
  @DeterminantLibInitialize := nil;
  @DeterminantLibTerminate := nil;

  StrPCopy(chPathName, 'cesta ke zminovane knihovne DLL');
  L:=loadlibrary(chPathName);
  if l <> 0 then try
    @mlfDeterminant := GetProcAddress(L,'_mlfDeterminant');
    @DeterminantLibInitialize := GetProcAddress(L,'_DeterminantLibInitialize');
    @DeterminantLibTerminate := GetProcAddress(L,'_DeterminantLibTerminate');

    if Assigned(DeterminantLibInitialize)
    and Assigned(DeterminantLibTerminate)
    and Assigned(mlfDeterminant) then begin

      DeterminantLibInitialize; - TADY VZNIKA CHYBA
zde by se mohla zavolat ta pozadovana funkce, ale nedoj de to sem
      DeterminantLibTerminate;

    end;

  finally
    FreeLibrary(l);
  end;